use PlatformDB


--select COUNT(*) from [platform].fieldValues

declare @i int 
declare @rowID int
select @i = 0

while (@i < 1 )
begin
	select @rowID = (select COUNT(*) from [platform].fieldValues) * RAND()
	
	insert into [platform].fieldValues(LoweredFieldName, ReversedTokenId, Value, TextValue, OriginalFieldName, CreatedOn, UpdatedOn)
		select LoweredFieldName, CAST( newid() as varchar(64)), CAST(NEWID() as varbinary(128)), TextValue, OriginalFieldName, CreatedOn, UpdatedOn
		from (
			select *--, ROW_NUMBER() over( order by reversedtokenid ) as RowID
			from [platform].fieldValues
		) as x
		-- where RowID = @rowID

	select @i = @i + 1
	
	print @i
end

--select * from [platform].fieldValues